package net1;

import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;

public class TcpClient {
    private static final String host = "127.0.0.1";
    private static final int port = 8888;

    public static void main(String[] args) throws IOException {
        Socket client = new Socket(host, port);
        OutputStream outputStream = client.getOutputStream();
        PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(outputStream, "utf-8"));
        printWriter.println("Hello I am client");
        printWriter.flush();
        client.close();
    }
}
